package com.ybkj.daijia.server.mapper;

import com.ybkj.daijia.server.vehicleInfo.Vehicle;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface VehicleMapper {

    List<Vehicle> queryBindVehicle(@Param("driverPhone") String driverPhone, @Param("driverName") String driverName);

    /**
     * 新建车辆
     * @param vehicle
     * @return
     */
    int createVehicle(Vehicle vehicle);

    /**
     * 根据车牌号查询车辆
     * @param carNumber
     * @return
     */
    List<Vehicle> getCarByCarNumber(@Param("carNumber") String carNumber);

    /**
     * 删除车辆
     * @param id
     * @return
     */
    int deleteVehicle(@Param("id") String id);

    /**
     * 根据id查询车辆
     * @param id
     * @return
     */
    Vehicle getVehicleById(String id);

    /**
     * 修改车辆信息
     * @param vehicle
     * @return
     */
    int editVehicle(Vehicle vehicle);

    /**
     * 根据公司id和车牌号查询未绑定的车辆集合
     * @param companyId
     * @param vehicleNumber
     * @return
     */
    List<Vehicle> getVehicleList(@Param("companyId") Long companyId,
        @Param("vehicleNumber") String vehicleNumber);

    /**
     * 多条件查询车辆
     * @param vehicleNumber
     * @param companyIdList
     * @param vehicleIdList
     * @return
     */
    List<Vehicle> getVehiclesByParams(@Param("vehicleNumber") String vehicleNumber, @Param("companyIdList") List<Long> companyIdList,
                                    @Param("vehicleIdList") List<String> vehicleIdList);

}
